using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_UIComposite_Paint_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.UIComposite.Paint);
            args = new Type[]{typeof(huqiang.Data.FakeStruct), typeof(huqiang.Core.HGUI.UIElement), typeof(huqiang.Core.HGUI.UIInitializer)};
            method = type.GetMethod("Initial", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Initial_0);
            args = new Type[]{};
            method = type.GetMethod("Resize", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Resize_1);

            field = type.GetField("Width", flag);
            app.RegisterCLRFieldGetter(field, get_Width_0);
            app.RegisterCLRFieldSetter(field, set_Width_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_Width_0, AssignFromStack_Width_0);
            field = type.GetField("Height", flag);
            app.RegisterCLRFieldGetter(field, get_Height_1);
            app.RegisterCLRFieldSetter(field, set_Height_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_Height_1, AssignFromStack_Height_1);
            field = type.GetField("BrushSize", flag);
            app.RegisterCLRFieldGetter(field, get_BrushSize_2);
            app.RegisterCLRFieldSetter(field, set_BrushSize_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_BrushSize_2, AssignFromStack_BrushSize_2);
            field = type.GetField("BrushColor", flag);
            app.RegisterCLRFieldGetter(field, get_BrushColor_3);
            app.RegisterCLRFieldSetter(field, set_BrushColor_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_BrushColor_3, AssignFromStack_BrushColor_3);
            field = type.GetField("drawModel", flag);
            app.RegisterCLRFieldGetter(field, get_drawModel_4);
            app.RegisterCLRFieldSetter(field, set_drawModel_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_drawModel_4, AssignFromStack_drawModel_4);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.UIComposite.Paint());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.UIComposite.Paint[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* Initial_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 4);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Core.HGUI.UIInitializer @initializer = (huqiang.Core.HGUI.UIInitializer)typeof(huqiang.Core.HGUI.UIInitializer).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Core.HGUI.UIElement @script = (huqiang.Core.HGUI.UIElement)typeof(huqiang.Core.HGUI.UIElement).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            huqiang.Data.FakeStruct @fake = (huqiang.Data.FakeStruct)typeof(huqiang.Data.FakeStruct).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            huqiang.UIComposite.Paint instance_of_this_method = (huqiang.UIComposite.Paint)typeof(huqiang.UIComposite.Paint).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Initial(@fake, @script, @initializer);

            return __ret;
        }

        static StackObject* Resize_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.Paint instance_of_this_method = (huqiang.UIComposite.Paint)typeof(huqiang.UIComposite.Paint).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Resize();

            return __ret;
        }


        static object get_Width_0(ref object o)
        {
            return ((huqiang.UIComposite.Paint)o).Width;
        }

        static StackObject* CopyToStack_Width_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.Paint)o).Width;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_Width_0(ref object o, object v)
        {
            ((huqiang.UIComposite.Paint)o).Width = (System.Int32)v;
        }

        static StackObject* AssignFromStack_Width_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @Width = ptr_of_this_method->Value;
            ((huqiang.UIComposite.Paint)o).Width = @Width;
            return ptr_of_this_method;
        }

        static object get_Height_1(ref object o)
        {
            return ((huqiang.UIComposite.Paint)o).Height;
        }

        static StackObject* CopyToStack_Height_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.Paint)o).Height;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_Height_1(ref object o, object v)
        {
            ((huqiang.UIComposite.Paint)o).Height = (System.Int32)v;
        }

        static StackObject* AssignFromStack_Height_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @Height = ptr_of_this_method->Value;
            ((huqiang.UIComposite.Paint)o).Height = @Height;
            return ptr_of_this_method;
        }

        static object get_BrushSize_2(ref object o)
        {
            return ((huqiang.UIComposite.Paint)o).BrushSize;
        }

        static StackObject* CopyToStack_BrushSize_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.Paint)o).BrushSize;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_BrushSize_2(ref object o, object v)
        {
            ((huqiang.UIComposite.Paint)o).BrushSize = (System.Single)v;
        }

        static StackObject* AssignFromStack_BrushSize_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @BrushSize = *(float*)&ptr_of_this_method->Value;
            ((huqiang.UIComposite.Paint)o).BrushSize = @BrushSize;
            return ptr_of_this_method;
        }

        static object get_BrushColor_3(ref object o)
        {
            return ((huqiang.UIComposite.Paint)o).BrushColor;
        }

        static StackObject* CopyToStack_BrushColor_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.Paint)o).BrushColor;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_BrushColor_3(ref object o, object v)
        {
            ((huqiang.UIComposite.Paint)o).BrushColor = (UnityEngine.Color)v;
        }

        static StackObject* AssignFromStack_BrushColor_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Color @BrushColor = (UnityEngine.Color)typeof(UnityEngine.Color).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            ((huqiang.UIComposite.Paint)o).BrushColor = @BrushColor;
            return ptr_of_this_method;
        }

        static object get_drawModel_4(ref object o)
        {
            return ((huqiang.UIComposite.Paint)o).drawModel;
        }

        static StackObject* CopyToStack_drawModel_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.Paint)o).drawModel;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_drawModel_4(ref object o, object v)
        {
            ((huqiang.UIComposite.Paint)o).drawModel = (huqiang.UIComposite.Paint.DrawModel)v;
        }

        static StackObject* AssignFromStack_drawModel_4(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.UIComposite.Paint.DrawModel @drawModel = (huqiang.UIComposite.Paint.DrawModel)typeof(huqiang.UIComposite.Paint.DrawModel).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)20);
            ((huqiang.UIComposite.Paint)o).drawModel = @drawModel;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.UIComposite.Paint();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
